﻿using System;
using System.Collections.Generic;
using System.Text;

namespace FingerTip.Sms.Core.Models
{
    public class SendTemplateMessageInput
    {
        /// <summary>
        /// 接收服务目标
        /// </summary>
        public virtual string Destrination { get; set; }
        /// <summary>
        /// 模版内容
        /// </summary>
        public virtual Dictionary<string,string> Data { get; set; }
        /// <summary>
        /// 扩展参数
        /// </summary>
        public virtual string ExtendParam { get; set; }
        /// <summary>
        /// 短信签名
        /// </summary>
        public virtual string SignName { get; set; }
        public virtual string TemplateCode { get; set; }

        public override string ToString()
        {
            var sb = new StringBuilder();
            sb.AppendLine($"Destination:{Destrination}");
            sb.AppendLine($"SignName:{SignName}");
            sb.AppendLine($"ExtendParam:{ExtendParam}");
            sb.AppendLine($"TemplateCode:{TemplateCode}");
            sb.AppendLine();
            sb.AppendLine("Data");
            sb.Append("{");
            foreach(var item in Data)
            {
                sb.AppendLine($"\"{item.Key}\":\"{item.Value}\",");
            }
            return sb.ToString().TrimEnd(',') + "};";
        }
    }
}
